package com.xyht.medicine_management_system.modules.kuaidi.controller;


import com.xyht.medicine_management_system.common.commonReturn.ResponseResult;
import com.xyht.medicine_management_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.medicine_management_system.modules.kuaidi.entity.req.MmsKuaidiInfoBatchReq;
import com.xyht.medicine_management_system.modules.kuaidi.entity.req.MmsKuaidiInfoReq;
import com.xyht.medicine_management_system.modules.kuaidi.service.MmsKuaidiInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * <p>
 * 商家发货快递信息 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2024-07-02
 */
@RestController
@RequestMapping("/kuaidi")
@SecretBody
public class MmsKuaidiInfoController {
    @Resource
    private MmsKuaidiInfoService mmsKuaidiInfoService;

    @ApiOperation("订单发货")
    @PostMapping("/send")
    public ResponseResult BatchSendKuaidi(@RequestBody MmsKuaidiInfoBatchReq batchReq) {
        return mmsKuaidiInfoService.BatchSendKuaidi(batchReq);
    }

    @ApiOperation("取消发货")
    @PostMapping("/cancel")
    public ResponseResult cancelKuaidi(@RequestBody MmsKuaidiInfoReq req) {
        return mmsKuaidiInfoService.cancelKuaidi(req);
    }

    @ApiOperation("快递物流查询")
    @PostMapping("/trackQuery")
    public ResponseResult getKuaidiTrackInfo(@RequestBody MmsKuaidiInfoReq req) {
        return mmsKuaidiInfoService.getKuaidiTrackInfo(req);
    }
    @ApiOperation("快递信息查询")
    @PostMapping("/query")
    public ResponseResult getKuaidiInfo(@RequestBody MmsKuaidiInfoReq req) {
        return mmsKuaidiInfoService.getKuaidiInfo(req);
    }

    @ApiOperation("打印电子面单")
    @PostMapping("/print")
    public ResponseResult printKuaidiInfo(@RequestBody MmsKuaidiInfoBatchReq req) {
        return mmsKuaidiInfoService.printKuaidiInfo(req);
    }

    @ApiOperation("下单回调接口")
    @PostMapping("/orderCallback")
    public Map<String,Object> kuaidiOrderInfoCallback(HttpServletRequest request) {
        return mmsKuaidiInfoService.kuaidiOrderInfoCallback(request);
    }

    @ApiOperation("快递信息推送回调接口")
    @PostMapping("/pushCallback")
    public Map<String,Object> kuaidiStatusInfoCallback(HttpServletRequest request) {
        return mmsKuaidiInfoService.kuaidiStatusInfoCallback(request);
    }


}

